package com.epfly.iface.promo.activity.enums;


import java.util.HashMap;
import java.util.Map;

/**
 * 活动类型:1.订单优惠;2.菜品优惠
 */
public enum ActivityTypeEnum {
    ORDER((byte) 1, "订单优惠"), FOOD((byte) 2, "菜品优惠");

    private Byte key;

    private String value;

    private ActivityTypeEnum() {

    }

    private static Map<Byte, ActivityTypeEnum> loopUp = new HashMap<>();

    static {
        for (ActivityTypeEnum value : values()) {
            loopUp.put(value.getKey(), value);
        }
    }

    public static String getValue(Byte key) {
        return loopUp.get(key).getValue();
    }

    private ActivityTypeEnum(Byte key, String value) {
        this.key = key;
        this.value = value;
    }

    public Byte getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
